﻿using Microsoft.EntityFrameworkCore;

namespace Dotnet6.Web.DbEntitys
{
    public static class EFDbSeedData
    {
        /// <summary>
        /// 添加种子数据
        /// </summary>
        public static async Task AddSeedDataAsync(this EFDbContext dbContext)
        {
            if (!await dbContext.UserInfos.AnyAsync())
                dbContext.UserInfos.Add(new UserInfo("管理员", "admin", "666", 20, "18696438628"));
            await dbContext.SaveChangesAsync();
        }
    }
}
